import request from '@/utils/request'

// 查询设备列表 /dev-api/system/device/list
export function listDevice(query) {
  return request({
    url: '/system/device/list',
    method: 'get',
    params: query
  })
}
// 查询设备列表-查询归属医院的和科室集合
export function listDeviceDept(query) {
  return request({
    url: '/system/device/list/dept',
    method: 'get',
    params: query
  })
}

// 获取设备详细信息/dev-api/system/device/{deviceId}
export function getDevice(deviceId) {
  return request({
    url: '/system/device/' + deviceId,
    method: 'get'
  })
}

// 新增设备 //dev-api/system/device
export function addDevice(data) {
  return request({
    url: '/system/device',
    method: 'post',
    data: data
  })
}

//修改设备 /dev-api/system/detection
export function updateDevice(data) {
  return request({
    url: '/system/device',
    method: 'put',
    data: data
  })
}

// 删除设备  /dev-api/system/device/{deviceIds}
export function delDevice(deviceIds) {
  return request({
    url: '/system/device/' + deviceIds,
    method: 'delete'
  })
}
///dev-api/system/device/updateStatus/{deviceId}/{status}
export function getDeviceUpdateStatus(deviceIds,status) {//停用设备
  return request({
    url: '/system/device/updateStatus/'+ deviceIds+'/'+status,
    method: 'get'

  })
}
//  查询平台设备列表
export function platformListDevice(query) {
  return request({
    url: '/system/device/platformList',
    method: 'get',
    params: query
  })
}
//  复制平台设备
export function copyPlatformDevice(deviceIds,deptId, hospitalId,) {
  return request({
    url: '/system/device/copyPlatform/' + deptId + "/" + hospitalId + "/" + deviceIds,
    method: 'get',
  })
}
